﻿using System;
using E_Commerce.Domain.Entities;
using E_Commerce.Domain.Interfaces;//引用
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
using AutoMapper;//引用AutoMapper
using E_Commerce.Application.Dto;

namespace E_Commerce.Application
{
    public class UserService : IUserService
    {
        //依赖注入
        private IUserRepository _userRepository;
        private IMapper _mapper;
        public UserService(IUserRepository userRepository, IMapper mapper)
        {
            this._userRepository = userRepository;
            this._mapper = mapper;
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="LoginName"></param>
        /// <param name="LoginPwd"></param>
        /// <returns></returns>
        public int LoginUser(string LoginName, string LoginPwd)
        {
            return _userRepository.LoginAsync(LoginName, LoginPwd);
        }
    }
}
